import request from '@/utils/request'

/* 获取会员信息 */
export function getMemberInfo() {
    return request({
        url: '/member/getMemberInfo',
        method: 'get',
    })
}

/* 获取乘客列表 */
export function getPassengerList() {
    return request({
        url: '/member/passenger/list',
        method: 'get'
    })
}

/* 新增乘客信息 */
export function addPassenger(data) {
    return request({
        url: '/member/passenger',
        method: 'post',
        data
    })
}

/* 删除乘客信息 */
export function deletePassenger(dataId) {
    return request({
        url: '/member/passenger/'+dataId,
        method: 'delete',
    })
}

/* 设置默认乘客 */
export function setDefaultPassenger(data) {
    return request({
        url: '/member/passenger/setDefault',
        method: 'put',
        data
    })
}

/* 会员信息修改 */
export function updateInfoSelf(data) {
    return request({
        url: '/member/update',
        method: 'put',
        data
    })
}

/* 获取地址列表 */
export function getAddressList() {
    return request({
        url: '/member/address/list',
        method: 'get'
    })
}

/* 新增地址信息 */
export function addAddress(data) {
    return request({
        url: '/member/address',
        method: 'post',
        data
    })
}

/* 删除地址信息 */
export function deleteAddress(dataId) {
    return request({
        url: '/member/address/'+dataId,
        method: 'delete',
    })
}

/* 设置默认地址 */
export function setDefaultAddress(data) {
    return request({
        url: '/member/address/setDefault',
        method: 'put',
        data
    })
}

/* 原邮箱验证码校验 */
export function verifyAuthCode(data) {
    return request({
        url: '/member/verifyAuthCode',
        method: 'put',
        data
    })
}

/* 邮箱更换 */
export function changeEmail(data) {
    return request({
        url: '/member/changeEmail',
        method: 'put',
        data
    })
}
